<template>
  <div id="app">
    11 {{$store.state.name}}  {{$store.state.age}}
  {{$store.getters.maAge}}
  <button @click="a">同步更改</button>
  <button @click="b">异步更改</button>
  </div>
</template>

<script>

export default {
  name: 'App',
  components: {
  },
  methods:{
    a(){
      this.$store.commit('changeName','liwei')
    },
    b(){
      this.$store.dispatch('changeName', 'dog')
    }
  },

  mounted(){
    // console.log(this.$store.getters)
  }
}
</script>

<style>
</style>
